package cn.zw.design.builder;

public  class Student {
	
	private int id;
	private String name;
	private int age;
	private int phone;
	private String address;
	
	
	public  void aa(){
		
	}
	
	
	public static class Builder{
		
		
		private int id;
		private String name;
		private int age;
		private int phone;
		private String address;
		
		public Builder(){
			
		}
		public Builder setName(String name){
			this.name = name;
			return this;
		}
		
		public Builder setId(int id){
			this.id = id;
			return this;
		}
		
		public Builder setAge(int age){
			this.age = age;
			return this;
		}
		
		public Builder setPhone(int phone){
			this.phone = phone;
			return this;
		}
		
		public Builder setAddress(String address){
			this.address = address;
			return this;
		}
		
		
		
		
		
		public Student build(){
			return new Student(this);
		}

		
	}
	
	
	private Student(Builder stu){
		this.id = stu.id;
		this.age=stu.age;
		this.address=stu.address;
		this.name=stu.name;
		this.phone=stu.phone;
		
	}
	
	public int getId() {
		return id;
	}
	public String getName() {
		return name;
	}
	public int getAge() {
		return age;
	}
	public int getPhone() {
		return phone;
	}
	public String getAddress() {
		return address;
	}
	
	
	
	
	

}
